const path = require('path')

document.addEventListener('DOMNodeInserted', (event) => {
  let isDev = process.env.NODE_ENV !== 'production';

  if (!!window && !(!!window.$)) {
    let jqPath = (isDev ?  path.join(__dirname,'../extraResources/jquery.js') : path.join(process.resourcesPath, 'extraResources/jquery.js'))
    let injectJs = (isDev ?  path.join(__dirname,'../extraResources/injection.js') : path.join(process.resourcesPath, 'extraResources/injection.js'))
    window.$ = window.jQuery = require( jqPath);
    require(injectJs)
    console.log(`inject jquery success.`)
  }
})


